# FILE: NumberFactory.py
# DESC: Factory implementation for Number objects.

from EntityFactory import EntityFactory
from web.entity.Number import Number 


class NumberFactory(EntityFactory):

	def __init__(self):
		EntityFactory.__init__(self)
		self.val_ = 0 


	def validate(self, argv):
		self.val_ = argv
		return True


	def doCreateEntity(self, consumer, relevanceFactor):
		number = Number(self.val_)
		if consumer:
			consumer.onNumber(number)
		return number


	def getEntityType(self):
		return "^[0-9]+$"
